package com.youlai.system.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.youlai.system.converter.CityConverter;
import com.youlai.system.mapper.CityMapper;
import com.youlai.system.model.entity.City;
import com.youlai.system.model.query.CityQuery;
import com.youlai.system.model.vo.CityVO;
import com.youlai.system.model.vo.SocialSecurityVO;
import com.youlai.system.service.CityService;
import lombok.Data;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Data
public class CityServiceImpl extends ServiceImpl<CityMapper, City> implements CityService {
    private final CityMapper cityMapper;
    private final CityConverter converter;
    @Override
    public PageInfo<CityVO> getCityList(CityQuery queryParams) {
        int pageNum = queryParams.getPageNum();
        int pageSize =20;
        String keyword = queryParams.getKeyword();

        PageHelper.startPage(pageNum, pageSize);
        List<CityVO> list = cityMapper.findAll(keyword);

        return new PageInfo<CityVO>(list);

    }
    
}
